<h3 class="content-title">
    Chỉnh sửa bài viết
</h3>
<hr/>
<div class="content-center">
    <form action="" method="post" enctype="multipart/form-data">
        <table>
            <tr>
                <td><label>Thumbnail:</label></td>
                <td>
                    <input id="file_upload" name="file_upload" type="file" />
                    <input type="hidden" name="thumb" id="thumb_src" value="<?php echo $node['thumb']; ?>" />
                    <div style="position: absolute; top: 180px; left: 600px;">
                        <img alt="Thumbnail" id="thumb" src="<?php echo $node['thumb']; ?>" style="border: 1px solid #DDD; padding:5px; width: 193px; height: 100px;"/>
                    </div>
                </td>
            </tr>
            <tr>
                <td><label>Tiêu đề:</label></td>
                <td><input type="text" name="title" class="text" value="<?php echo $node['title']; ?>"></td>
            </tr>
            <tr>
                <td><label>Link Event:</label></td>
                <td><input type="text" name="link" class="text" value="<?php echo $node['link']; ?>"></td>
            </tr>
            <tr>
                <td><label>Mô tả:</label><span class="quiet">(200 ký tự)</span></td>
                <td style="float:left; margin: 5px 0"><textarea id="description" name="description" style="width: 650px; height: 50px"><?php echo $node['description']; ?></textarea></td>
            </tr>
            <tr>
                <td><input type="hidden" name="category_id" value="28"/><input type="hidden" name="node_id" value="<?php echo $node['node_id']; ?>"/></td>
                <td><input type="submit" name="update" value="Hoàn tất" class="button"/></td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>static/uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>static/uploadify/swfobject.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>static/nicEdit/nicEdit.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('#file_upload').uploadify({
        'uploader'  : config.baseUrl + 'static/uploadify/uploadify.swf',
        'script'    : config.baseUrl + 'static/uploadify/uploadify.php',
        'cancelImg' : config.baseUrl + 'static/uploadify/cancel.png',
        'folder'    : '/uploads/',
        'auto'      : true,
        'multi'     : false,
        'fileExt'   : '*.jpg;*.jpeg;*.png;*.gif',
        onComplete  : function(event, queueID, fileObj, response, data){
            //Parse json
            response = JSON.parse(response);
            
            $('#thumb').attr('src', response.src);
            $('#thumb_src').val(response.src);
        }
    });

    new nicEditor().panelInstance('description');
});
</script>